]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
automountManager: Port to MetaSoundPlayer for emitting sounds
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 13 Dec 2018 19:30:22 +0000 (20:30 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Wed, 9 Jan 2019 23:09:18 +0000 (23:09 +0000)
Move away from ShellGlobal API, which is too tightly coupled to
libcanberra-gtk.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/327

js/ui/components/automountManager.js

index a64fc0d35065d14a2f66bd18d51f8d282ec14cce..579c8a6b3c097dddf045eed2730db627ad30bbe7 100644 (file)
@@ -87,9 +87,10 @@ var AutomountManager = new Lang.Class({
         if (!this._session.SessionIsActive)
             return;
 
-        global.play_theme_sound(0, 'device-added-media',
-                                _("External drive connected"),
-                                null);
+        let player = global.display.get_sound_player();
+        player.play_from_theme('device-added-media',
+                               _("External drive connected"),
+                               null);
     },
 
     _onDriveDisconnected() {
@@ -98,9 +99,10 @@ var AutomountManager = new Lang.Class({
         if (!this._session.SessionIsActive)
             return;
 
-        global.play_theme_sound(0, 'device-removed-media',
-                                _("External drive disconnected"),
-                                null);
+        let sound = global.display.get_sound();
+        sound.play_from_theme('device-removed-media',
+                              _("External drive disconnected"),
+                              null);
     },
 
     _onDriveEjectButton(monitor, drive) {